<?php
function do_header() {
	include('fen_fns.php');
	sec_session_start ();
	
	?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php echo MAINTITLE; ?></title>
<link rel="stylesheet" href="css/main.css?version=1" type="text/css" />
<script type="text/javascript" src="scripts/sha512.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
        $(function() {
        	$('#toggle1').click(function() {
        		    $('.toggle1').slideToggle('fast');
        		    return false;
        	});            
        });
</script> 
<script type="text/javascript">

function formhash(form, password) 
{
   var p,
       val = hex_sha512(password.value);
   
   try
   { 
     p = document.createElement("<input name='p' type='hidden' value='" + val + "'>"); 
   }
   catch( e )
   {
     p = document.createElement("input");
     p.name = "p";
     p.type = "hidden"
     p.value = val;       
   }
   
   password.value = "";  

   form.appendChild(p);
   
   form.submit();
}
</script>

</head>
<body id="main">

	<div class="toggle1">
		<p>
<?php
		if (isset ( $_GET ['error'] )) {	
?>
		<script type="text/javascript">
			$(function() {
				$('.toggle1').slideToggle('normal');
				setInterval("$('.toggle1').fadeOut('slow')",2500);		            
			});
		</script>
		<img src="images/errorGreen.png">
<?php	
		error($_GET['error']);
	}
?>
			</img>
		</p>
	</div>

	<div id="page">




	
			
			<div class="pageMemberTop1">
			<div class="pageMemberTop1Left">
				<a href="index.php"><img src="images/logoBuzeb.gif"></img></a>
			</div>
			<div class="pageMemberTop1Right">
				<a href="index.php">Ana Sayfa</a>&nbsp;&nbsp; | &nbsp;&nbsp;<a href="mailto:onur.mendi@de.bahcesehir.edu.tr">Yardım</a>
			</div>
			
		</div>
	
		

		<div class="pageTop2">
			<p id="header1">&nbsp;Hoşgeldiniz</p>
			<p id="welcome">&nbsp;&nbsp;Lütfen sisteme giriş yapınız.</p>
			<?php //<a href="index.php"><img id="logo" align="right" src="images/eventAcademyLogo.png"></img></a> ?>
		</div>

		<div class="pageMiddle">
			
			<div class="loginBack">

				<img class="loginleft" src="images/loginleftimage.gif"></img>
				<form action="login.php" method="post" name="login_form">
					<table id="tableLogin">
						<tr>
							<td><p>Kullanıcı Adınız</p></td>
							<td id="tableLoginTd2"><input id="txtEmail" name="email"
								type="text" tabindex="1" value="<?php echo $_COOKIE["username"]; ?>"></td>
						</tr>
						<tr>
							<td>Şifreniz</td>
							<td id="tableLoginTd2"><input id="txtEmail" name="password"
								type="password" tabindex="1"></td>

						</tr>
						<tr>
							<td></td>
							<td id="tableLoginTd2"><input type="checkbox"
								id="tableLoginCheckBox" name="rememberPassword" value="on" style="width: auto;"
								tabindex="3" checked><label for="chkRemember" class="frem">&nbsp;Beni
									Hatırla</label> <br> <button class="buttonLoginScreen" id="buttonLoginScreen" type="submit" onclick="formhash(this.form, this.form.password);">GİRİŞ</button>
								 

								<?php //<p id="tableLoginP1">Şifremi unuttum</p></td> ?>
						</tr>
					</table>
				</form>

			</div>
			<div class="designedBy"><font color=#666666>Created by: <a href="mailto:onur.mendi@de.bahcesehir.edu.tr">BUZEB</a></font></div>
		</div>
	
<?php

}

function do_footer() {
	?>
	<script type="text/javascript">
	var menu=new menu.dd("menu");
	menu.init("menu","menuhover");
	</script>
	</body>
</html>
<?php
}



function do_member_header($tag, $tagmenu) {
	include('inc/db.php');
	sec_session_start();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><?php echo MAINTITLE; ?></title>
<link rel="stylesheet" href="css/main.css?version=<?php echo time(); ?>" type="text/css" />
<link rel="stylesheet" href="css/table.css?version=<?php echo time(); ?>" type="text/css" />
<link rel="stylesheet" href="css/morris.css?version=<?php echo time(); ?>" type="text/css" />
<link rel="stylesheet" href="css/TableTools.css?version=<?php echo time(); ?>" type="text/css" />
<script type="text/javascript" src="scripts/script.js"></script>
<script type="text/javascript" src="scripts/sha512.js"></script>
<script type="text/javascript" src="scripts/forms.js"></script>
<script type="text/javascript" src="scripts/livevalidation_standalone.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="https://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="scripts/morris-0.4.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script type="text/javascript" src="scripts/jquery.dataTables.js"></script>
<link href="scripts/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script src="scripts/facebox/facebox.js" type="text/javascript"></script> 
<script type="text/javascript" src="scripts/jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript" src="scripts/TableTools.js"></script>
<script type="text/javascript" src="scripts/ZeroClipboard.js"></script>
<script src="scripts/main.js" type="text/javascript"></script>


</head>
<body id="memberMain">


	<div class="toggle1">
		<p>


		<img src="images/errorGreen.png">

			</img>
		</p>
	</div>
	
	<div id="sonuc"></div>
	
	<div id="pageMember">

		<div class="pageMemberTop1">
			<div class="pageMemberTop1Left">
				<a href="member.php"><img src="images/logoBuzeb.gif"></img></a>
			</div>
			<div class="pageMemberTop1Right">
				<a href="member.php">
				<?php
     
     			$query = $_DB->Query("SELECT fen_members.name, fen_members.surname, fen_members.titr, fen_faculty.faculty_name, fen_department.department_name FROM fen_members, fen_faculty, fen_department where fen_members.username = '".$_SESSION['username']."' and fen_members.faculty_id = fen_faculty.id and fen_members.department_id = fen_department.id");

				echo $_DB->GetResultValue($query, "0", "titr")." ".$_DB->GetResultValue($query, "0", "name")." ".$_DB->GetResultValue($query, "0", "surname");


?>
				
				
				</a>&nbsp;&nbsp; | &nbsp;&nbsp;<a href="logout.php">Çıkış</a>
			</div>
			
		</div>

		<div class="pageMemberTop2">
			<div class="pageMemberTop2Left">
			
				<ul class="menu" id="menu">
<?php

if ($_SESSION['type'] == '1') {

?>	
					<li><a href="member.php" class="menulink<?php if ($tagmenu == "1") { echo "Active"; } ?>">Özet </a></li>
<?php

}
if ($_SESSION['type'] == '1') {

?>					
					<li><a class="menulink<?php if ($tagmenu == "2") { echo "Active"; } ?>">Formlar <img src="images/arrow-down<?php if ($tagmenu == "2") { echo "-black"; } ?>.gif"></a>
						<ul>
							<li><a href="form.php?fid=1">Bilimsel Toplantılar</a></li>
							<li><a href="form.php?fid=2">Bilimsel Yayınlar</a></li>
						</ul>
					</li>
<?php 
}

if ($_SESSION['access_level'] >= 50) {
?>						
					<li>
						<a class="menulink<?php if ($tagmenu == "3") { echo "Active"; } ?>">Müracaatlar <img src="images/arrow-down<?php if ($tagmenu == "3") { echo "-black"; } ?>.gif"></a>
						<ul>
							<li><a href="applications.php">Yayın Teşvik Müracaatları</a></li>
							
						</ul>
					</li>
<?php 
}

if ($_SESSION['access_level'] >= 50 && $_SESSION['access_level'] != 70) {
?>					
					<li><a class="menulink<?php if ($tagmenu == "4") { echo "Active"; } ?>">Raporlar <img src="images/arrow-down<?php if ($tagmenu == "4") { echo "-black"; } ?>.gif"></a>
						<ul>
							
							<li>
								<a class="sub2">Yayın Raporları</a>
								<ul>
									<li><a href="reports.php?rid=<?php if ($_SESSION['access_level'] >= 100) { echo "3"; } else { echo "1"; } ?>">Özet Rapor</a></li>
									<li><a href="reports.php?rid=2">Ayrıntılı Rapor</a></li>
									
								</ul>
							</li>
							<li>
								<a class="sub2">Bilimsel Toplantı Raporları</a>
								<ul>
									<li><a href="reports.php?rid=4">Ayrıntılı Rapor</a></li>
								</ul>
							</li>
							
						</ul>
					</li>
<?php 
}

if ($_SESSION['access_level'] >= 100) {
?>
					<li>
						<a href="#" class="menulink<?php if ($tagmenu == "5") { echo "Active"; } ?>">Tanımlar <img src="images/arrow-down<?php if ($tagmenu == "5") { echo "-black"; } ?>.gif"></a>
						<ul>
							<li><a href="users.php">Kullanıcı İşlemleri</a></li>						
						</ul>
					</li>
<?php 
}
?>					
					<li>
						<a class="menulink<?php if ($tagmenu == "6") { echo "Active"; } ?>">Kişisel <img src="images/arrow-down<?php if ($tagmenu == "6") { echo "-black"; } ?>.gif"></a>
						<ul>
							<li><a href="updateaccinfo.php">Bilgi Güncelleme</a></li>	
							<li><a href="changepassword.php">Şifre Değiştirme</a></li>				
						</ul>
					</li>
				</ul>
				
			</div>
			<div class="pageMemberTop2Right">
				<div class="pageMemberTop2RightA">
					<p id="pageMemberTop2RightP1"><?php echo $_DB->GetResultValue($query, "0", "faculty_name"); ?></p>
							<p id="pageMemberTop2RightP2"><?php 
							
							if (strlen($_DB->GetResultValue($query, "0", "department_name")) > 31) {
								$depname = substr($_DB->GetResultValue($query, "0", "department_name"),0,31)."...";
							} else {
								$depname = $_DB->GetResultValue($query, "0", "department_name");
							}
							
							echo $depname; ?></p>
				</div>
				<div class="pageMemberTop2RightB">
					<a href="changepassword.php" class="cssmouseover"></a>
				</div>

			</div>
		</div>
		
		<div class="pageMemberTag">
			<p><?php echo $tag; ?></p>
		</div>
		
		

<script type="text/javascript">
	var menu=new menu.dd("menu");
	menu.init("menu","menuhover");
</script>
	
<?php
	


}

function do_summary() {


	include ('fen_fns.php');
	$query2009 = $_DB->Query("SELECT IFNULL(SUM(yayin_tipi = 'Makale'), 0) AS makale, IFNULL(SUM(yayin_tipi = 'Kitap Bölümü'),0) AS kitapbolumu, IFNULL(SUM(yayin_tipi = 'Kitap'),0) AS kitap FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_yili = '2009'");
	$query2010 = $_DB->Query("SELECT IFNULL(SUM(yayin_tipi = 'Makale'), 0) AS makale, IFNULL(SUM(yayin_tipi = 'Kitap Bölümü'),0) AS kitapbolumu, IFNULL(SUM(yayin_tipi = 'Kitap'),0) AS kitap FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_yili = '2010'");
	$query2011 = $_DB->Query("SELECT IFNULL(SUM(yayin_tipi = 'Makale'), 0) AS makale, IFNULL(SUM(yayin_tipi = 'Kitap Bölümü'),0) AS kitapbolumu, IFNULL(SUM(yayin_tipi = 'Kitap'),0) AS kitap FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_yili = '2011'");
	$query2012 = $_DB->Query("SELECT IFNULL(SUM(yayin_tipi = 'Makale'), 0) AS makale, IFNULL(SUM(yayin_tipi = 'Kitap Bölümü'),0) AS kitapbolumu, IFNULL(SUM(yayin_tipi = 'Kitap'),0) AS kitap FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_yili = '2012'");
	$query2013 = $_DB->Query("SELECT IFNULL(SUM(yayin_tipi = 'Makale'), 0) AS makale, IFNULL(SUM(yayin_tipi = 'Kitap Bölümü'),0) AS kitapbolumu, IFNULL(SUM(yayin_tipi = 'Kitap'),0) AS kitap FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_yili = '2013'");
	$query2014 = $_DB->Query("SELECT IFNULL(SUM(yayin_tipi = 'Makale'), 0) AS makale, IFNULL(SUM(yayin_tipi = 'Kitap Bölümü'),0) AS kitapbolumu, IFNULL(SUM(yayin_tipi = 'Kitap'),0) AS kitap FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_yili = '2014'");
	
	$querytoplanti2009 = $_DB->Query("SELECT count(id) AS bildiri FROM fen_toplanti WHERE member_id = '".$_SESSION['user_id']."' and YEAR(tarih1) = '2009'");
	$querytoplanti2010 = $_DB->Query("SELECT count(id) AS bildiri FROM fen_toplanti WHERE member_id = '".$_SESSION['user_id']."' and YEAR(tarih1) = '2010'");
	$querytoplanti2011 = $_DB->Query("SELECT count(id) AS bildiri FROM fen_toplanti WHERE member_id = '".$_SESSION['user_id']."' and YEAR(tarih1) = '2011'");
	$querytoplanti2012 = $_DB->Query("SELECT count(id) AS bildiri FROM fen_toplanti WHERE member_id = '".$_SESSION['user_id']."' and YEAR(tarih1) = '2012'");
	$querytoplanti2013 = $_DB->Query("SELECT count(id) AS bildiri FROM fen_toplanti WHERE member_id = '".$_SESSION['user_id']."' and YEAR(tarih1) = '2013'");
	$querytoplanti2014 = $_DB->Query("SELECT count(id) AS bildiri FROM fen_toplanti WHERE member_id = '".$_SESSION['user_id']."' and YEAR(tarih1) = '2014'");

?>

	<script type="text/javascript">

	

	$(function() {


		$('#chart').change(function(){

	           
            if ($(this).val() == '0') {

            	$('#chartdiv').empty();

            	Morris.Bar({
        			  element: 'chartdiv',
        			  data: [
        			    { y: '2009', <?php echo "a: ".$_DB->GetResultValue($query2009, "0", "makale").", b: ".$_DB->GetResultValue($query2009, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2009, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2009, "0", "bildiri"); ?> },
        			    { y: '2010', <?php echo "a: ".$_DB->GetResultValue($query2010, "0", "makale").", b: ".$_DB->GetResultValue($query2010, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2010, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2010, "0", "bildiri"); ?> },
        			    { y: '2011', <?php echo "a: ".$_DB->GetResultValue($query2011, "0", "makale").", b: ".$_DB->GetResultValue($query2011, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2011, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2011, "0", "bildiri"); ?> },
        			    { y: '2012', <?php echo "a: ".$_DB->GetResultValue($query2012, "0", "makale").", b: ".$_DB->GetResultValue($query2012, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2012, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2012, "0", "bildiri"); ?> },
        			    { y: '2013', <?php echo "a: ".$_DB->GetResultValue($query2013, "0", "makale").", b: ".$_DB->GetResultValue($query2013, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2013, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2013, "0", "bildiri"); ?> },
        			    { y: '2014', <?php echo "a: ".$_DB->GetResultValue($query2014, "0", "makale").", b: ".$_DB->GetResultValue($query2014, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2014, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2014, "0", "bildiri"); ?> }
        			  ],
        			  xkey: 'y',
        			  ykeys: ['a', 'b', 'c', 'd'],
        			  labels: ['Makale', 'Kitap Bölümü', 'Kitap', 'Bildiri'],
        			  barColors: ['#0061a6', '#7a92a3', '#4da74d', '#0099cc']
        			});
            	
            } else if ($(this).val() == '1') {
				
            	$('#chartdiv').empty();
            	
            	Morris.Line({
        			  element: 'chartdiv',
        			  data: [
        			    { y: '2009', <?php echo "a: ".$_DB->GetResultValue($query2009, "0", "makale").", b: ".$_DB->GetResultValue($query2009, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2009, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2009, "0", "bildiri"); ?> },
        			    { y: '2010', <?php echo "a: ".$_DB->GetResultValue($query2010, "0", "makale").", b: ".$_DB->GetResultValue($query2010, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2010, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2010, "0", "bildiri"); ?> },
        			    { y: '2011', <?php echo "a: ".$_DB->GetResultValue($query2011, "0", "makale").", b: ".$_DB->GetResultValue($query2011, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2011, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2011, "0", "bildiri"); ?> },
        			    { y: '2012', <?php echo "a: ".$_DB->GetResultValue($query2012, "0", "makale").", b: ".$_DB->GetResultValue($query2012, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2012, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2012, "0", "bildiri"); ?> },
        			    { y: '2013', <?php echo "a: ".$_DB->GetResultValue($query2013, "0", "makale").", b: ".$_DB->GetResultValue($query2013, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2013, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2013, "0", "bildiri"); ?> },
        			    { y: '2014', <?php echo "a: ".$_DB->GetResultValue($query2014, "0", "makale").", b: ".$_DB->GetResultValue($query2014, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2014, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2014, "0", "bildiri"); ?> }
        			  ],
        			  xkey: 'y',
        			  ykeys: ['a', 'b', 'c', 'd'],
        			  labels: ['Makale', 'Kitap Bölümü', 'Kitap', 'Bildiri'],
        			  lineColors: ['#0061a6', '#7a92a3', '#4da74d', '#0099cc']
        			});
            	
            } else if ($(this).val() == '2') {
				
            	$('#chartdiv').empty();
            	
            	Morris.Area({
        			  element: 'chartdiv',
        			  data: [
        			    { y: '2009', <?php echo "a: ".$_DB->GetResultValue($query2009, "0", "makale").", b: ".$_DB->GetResultValue($query2009, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2009, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2009, "0", "bildiri"); ?> },
        			    { y: '2010', <?php echo "a: ".$_DB->GetResultValue($query2010, "0", "makale").", b: ".$_DB->GetResultValue($query2010, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2010, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2010, "0", "bildiri"); ?> },
        			    { y: '2011', <?php echo "a: ".$_DB->GetResultValue($query2011, "0", "makale").", b: ".$_DB->GetResultValue($query2011, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2011, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2011, "0", "bildiri"); ?> },
        			    { y: '2012', <?php echo "a: ".$_DB->GetResultValue($query2012, "0", "makale").", b: ".$_DB->GetResultValue($query2012, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2012, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2012, "0", "bildiri"); ?> },
        			    { y: '2013', <?php echo "a: ".$_DB->GetResultValue($query2013, "0", "makale").", b: ".$_DB->GetResultValue($query2013, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2013, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2013, "0", "bildiri"); ?> },
        			    { y: '2014', <?php echo "a: ".$_DB->GetResultValue($query2014, "0", "makale").", b: ".$_DB->GetResultValue($query2014, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2014, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2014, "0", "bildiri"); ?> }
        			  ],
        			  xkey: 'y',
        			  ykeys: ['a', 'b', 'c', 'd'],
        			  labels: ['Makale', 'Kitap Bölümü', 'Kitap', 'Bildiri'],
        			  lineColors: ['#0061a6', '#7a92a3', '#4da74d', '#0099cc']
        			});
            	
            }

        });

        
    });

	$(document).ready(function() {

		Morris.Line({
			  element: 'chartdiv',
			  data: [
			    { y: '2009', <?php echo "a: ".$_DB->GetResultValue($query2009, "0", "makale").", b: ".$_DB->GetResultValue($query2009, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2009, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2009, "0", "bildiri"); ?> },
			    { y: '2010', <?php echo "a: ".$_DB->GetResultValue($query2010, "0", "makale").", b: ".$_DB->GetResultValue($query2010, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2010, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2010, "0", "bildiri"); ?> },
			    { y: '2011', <?php echo "a: ".$_DB->GetResultValue($query2011, "0", "makale").", b: ".$_DB->GetResultValue($query2011, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2011, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2011, "0", "bildiri"); ?> },
			    { y: '2012', <?php echo "a: ".$_DB->GetResultValue($query2012, "0", "makale").", b: ".$_DB->GetResultValue($query2012, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2012, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2012, "0", "bildiri"); ?> },
			    { y: '2013', <?php echo "a: ".$_DB->GetResultValue($query2013, "0", "makale").", b: ".$_DB->GetResultValue($query2013, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2013, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2013, "0", "bildiri"); ?> },
			    { y: '2014', <?php echo "a: ".$_DB->GetResultValue($query2014, "0", "makale").", b: ".$_DB->GetResultValue($query2014, "0", "kitapbolumu").", c: ".$_DB->GetResultValue($query2014, "0", "kitap").", d: ".$_DB->GetResultValue($querytoplanti2014, "0", "bildiri"); ?> }
			  ],
			  xkey: 'y',
			  ykeys: ['a', 'b', 'c', 'd'],
			  labels: ['Makale', 'Kitap Bölümü', 'Kitap', 'Bildiri'],
			  lineColors: ['#0061a6', '#7a92a3', '#4da74d', '#0099cc']
			});

	});

	tooltip();
	</script>
	
	<div class="contentMain">
		
	
		<div class="showtable">
			<br><br>
			<div class="summaryTableSmall">
				<div class="summaryTableSmallTop">
					Hoşgeldiniz
				</div>
				<div class="summaryTableSmallMiddle">
					<p id="tesvikp">Sayın <b>
<?php 
						$query = $_DB->Query("SELECT fen_members.name, fen_members.surname, fen_members.titr, fen_faculty.faculty_name, fen_department.department_name FROM fen_members, fen_faculty, fen_department where fen_members.username = '".$_SESSION['username']."' and fen_members.faculty_id = fen_faculty.id and fen_members.department_id = fen_department.id");
						$query2 = $_DB->Query("SELECT
									date_FORMAT(time , '%d.%m.%Y %H:%i') as logintime 
									FROM fen_logins
									WHERE
									fen_logins.user_id = '".$_SESSION['user_id']."'
									ORDER BY time DESC LIMIT 1,1");

						$querytesvik = $_DB->Query("SELECT id from fen_publication_app
													where member_id = '".$_SESSION['user_id']."'");
						$count = $_DB->GetResultNumber($querytesvik);

						echo $_DB->GetResultValue($query, "0", "name")." ".$_DB->GetResultValue($query, "0", "surname");
						
						$querymuracaat = $_DB->Query("SELECT IFNULL(SUM(status = '2'), 0) AS komisyon, IFNULL(SUM(status = '3'), 0) AS rektorluk, IFNULL(SUM(status = '4'), 0) AS mali, IFNULL(SUM(status = '5'), 0) AS odendi, IFNULL(SUM(status = '0'), 0) AS red
												   from fen_publication_app 
												   where member_id = '".$_SESSION['user_id']."'");
					
						$queryyayin = $_DB->Query("SELECT SUM(IF(yayin_tipi = 'Makale', 1,0)) AS 'makale', SUM(IF(yayin_tipi = 'Kitap Bölümü', 1,0)) AS 'kitap_bolumu', SUM(IF(yayin_tipi = 'Kitap', 1,0)) AS 'kitap' FROM `fen_publications` WHERE member_id = '".$_SESSION['user_id']."'");
						
						$_DB->Query("SET @rownum := 0");
						$query_faculty_rank_makale = $_DB->Query("select rank, @rownum as max FROM (SELECT @rownum := @rownum+1 AS rank, makale from (SELECT DISTINCT(SUM(IF(yayin_tipi = 'Makale', 1,0))) AS 'makale' FROM `fen_publications`, `fen_members` WHERE fen_publications.member_id = fen_members.id and fen_members.faculty_id = (select faculty_id from fen_members where id = '".$_SESSION['user_id']."') GROUP BY member_id ORDER BY makale DESC) as t1) as t2 WHERE makale = '".$_DB->GetResultValue($queryyayin, 0, "makale")."'");
						$_DB->Query("SET @rownum := 0");
						$query_faculty_rank_kitap_bolumu = $_DB->Query("select rank, @rownum as max FROM (SELECT @rownum := @rownum+1 AS rank, kitap_bolumu from (SELECT DISTINCT(SUM(IF(yayin_tipi = 'Kitap Bölümü', 1,0))) AS 'kitap_bolumu' FROM `fen_publications`, `fen_members` WHERE fen_publications.member_id = fen_members.id and fen_members.faculty_id = (select faculty_id from fen_members where id = '".$_SESSION['user_id']."') GROUP BY member_id ORDER BY kitap_bolumu DESC) as t1) as t2 WHERE kitap_bolumu = '".$_DB->GetResultValue($queryyayin, 0, "kitap_bolumu")."'");
						$_DB->Query("SET @rownum := 0");
						$query_faculty_rank_kitap = $_DB->Query("select rank, @rownum as max FROM (SELECT @rownum := @rownum+1 AS rank, kitap from (SELECT DISTINCT(SUM(IF(yayin_tipi = 'Kitap', 1,0))) AS 'kitap' FROM `fen_publications`, `fen_members` WHERE fen_publications.member_id = fen_members.id and fen_members.faculty_id = (select faculty_id from fen_members where id = '".$_SESSION['user_id']."') GROUP BY member_id ORDER BY kitap DESC) as t1) as t2 WHERE kitap = '".$_DB->GetResultValue($queryyayin, 0, "kitap")."'");
						
						$_DB->Query("SET @rownum := 0");
						$query_university_rank_makale = $_DB->Query("select rank, @rownum as max FROM (SELECT @rownum := @rownum+1 AS rank, makale from (SELECT DISTINCT(SUM(IF(yayin_tipi = 'Makale', 1,0))) AS 'makale' FROM `fen_publications`, `fen_members` WHERE fen_publications.member_id = fen_members.id GROUP BY member_id ORDER BY makale DESC) as t1) as t2 WHERE makale = '".$_DB->GetResultValue($queryyayin, 0, "makale")."'");
						$_DB->Query("SET @rownum := 0");
						$query_university_rank_kitap_bolumu = $_DB->Query("select rank, @rownum as max FROM (SELECT @rownum := @rownum+1 AS rank, kitap_bolumu from (SELECT DISTINCT(SUM(IF(yayin_tipi = 'Kitap Bölümü', 1,0))) AS 'kitap_bolumu' FROM `fen_publications`, `fen_members` WHERE fen_publications.member_id = fen_members.id GROUP BY member_id ORDER BY kitap_bolumu DESC) as t1) as t2 WHERE kitap_bolumu = '".$_DB->GetResultValue($queryyayin, 0, "kitap_bolumu")."'");
						$_DB->Query("SET @rownum := 0");
						$query_university_rank_kitap = $_DB->Query("select rank, @rownum as max FROM (SELECT @rownum := @rownum+1 AS rank, kitap from (SELECT DISTINCT(SUM(IF(yayin_tipi = 'Kitap', 1,0))) AS 'kitap' FROM `fen_publications`, `fen_members` WHERE fen_publications.member_id = fen_members.id GROUP BY member_id ORDER BY kitap DESC) as t1) as t2 WHERE kitap = '".$_DB->GetResultValue($queryyayin, 0, "kitap")."'");
						
						
	
?>
					</font>,</b>
					
					<br><p id="tesvikp">Sisteme giriş yaptığınız son saat: <b><font color="#0289b5"><?php echo $_DB->GetResultValue($query2, "0", "logintime"); ?></b></font></p>
						
					<table cellspacing="0" cellpadding="0" class="summaryTableTesvik">
							<tr id="summaryTableMakaleRowTop">
								<td id="summaryTableMakaleTD1c">&nbsp; Yayın Sıralamanız</td>
								<td bgcolor="#d9edf9"><font color="#555555">Makale</font></td>
								<td bgcolor="#d9edf9"><font color="#555555">Kitap Bölümü</font></td>
								<td bgcolor="#d9edf9"><font color="#555555">Kitap</font></td>
							</tr>
							<tr id="summaryTableMakaleRow1">
								<td id="summaryTableMakaleTD1">&nbsp; Fakülte</td>
								<td bgcolor="#fafafa"><?php if ($_DB->GetResultValue($query_faculty_rank_makale, 0, "rank")) { echo $_DB->GetResultValue($query_faculty_rank_makale, 0, "rank")."."; } else { echo "-"; } ?><a class="tooltip" title="Yayın sayısına göre en kötü sıra: <b><?php echo $_DB->GetResultValue($query_faculty_rank_makale, 0, "max"); ?>"></b><img src="images/reasonicon.gif"></img></a></td>
								<td bgcolor="#fafafa"><?php if ($_DB->GetResultValue($query_faculty_rank_kitap_bolumu, 0, "rank")) { echo $_DB->GetResultValue($query_faculty_rank_kitap_bolumu, 0, "rank")."."; } else { echo "-"; } ?><a class="tooltip" title="Yayın sayısına göre en kötü sıra: <b><?php echo $_DB->GetResultValue($query_faculty_rank_kitap_bolumu, 0, "max"); ?>"></b><img src="images/reasonicon.gif"></img></a></td>
								<td bgcolor="#fafafa"><?php if ($_DB->GetResultValue($query_faculty_rank_kitap, 0, "rank")) { echo $_DB->GetResultValue($query_faculty_rank_kitap, 0, "rank")."."; } else { echo "-"; } ?><a class="tooltip" title="Yayın sayısına göre en kötü sıra: <b><?php echo $_DB->GetResultValue($query_faculty_rank_kitap, 0, "max"); ?>"></b><img src="images/reasonicon.gif"></img></a></td>
							</tr>
							<tr id="summaryTableMakaleRow2">
								<td id="summaryTableMakaleTD1">&nbsp; Üniversite</td>
								<td bgcolor="#f0f0f0"><?php if ($_DB->GetResultValue($query_university_rank_makale, 0, "rank")) { echo $_DB->GetResultValue($query_university_rank_makale, 0, "rank")."."; } else { echo "-"; } ?><a class="tooltip" title="Yayın sayısına göre en kötü sıra: <b><?php echo $_DB->GetResultValue($query_university_rank_makale, 0, "max"); ?>"></b><img src="images/reasonicon.gif"></img></a></td>
								<td bgcolor="#f0f0f0"><?php if ($_DB->GetResultValue($query_university_rank_kitap_bolumu, 0, "rank")) { echo $_DB->GetResultValue($query_university_rank_kitap_bolumu, 0, "rank")."."; } else { echo "-"; } ?><a class="tooltip" title="Yayın sayısına göre en kötü sıra: <b><?php echo $_DB->GetResultValue($query_university_rank_kitap_bolumu, 0, "max"); ?>"></b><img src="images/reasonicon.gif"></img></a></td>
								<td bgcolor="#f0f0f0"><?php if ($_DB->GetResultValue($query_university_rank_kitap, 0, "rank")) { echo $_DB->GetResultValue($query_university_rank_kitap, 0, "rank")."."; } else { echo "-"; } ?><a class="tooltip" title="Yayın sayısına göre en kötü sıra: <b><?php echo $_DB->GetResultValue($query_university_rank_kitap, 0, "max"); ?>"></b><img src="images/reasonicon.gif"></img></a></td>
							</tr>
					</table>
						
					<?php /*
					<br><p id="tesvikp">Sisteme giriş yaptığınız son saat: <b><font color="#0289b5"><?php echo $_DB->GetResultValue($query2, "0", "logintime"); ?></b></font></p>
					<p id="puserdetailed">&nbsp;&nbsp;Fakülte yayın sıralamanız&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: <a class="tooltip" title="Bu rakam toplam yayın sayınıza göre <b>fakülte</b> sıralamasında<br>belirtilen aralıkta kaçıncı grupta olduğunuzu ifade etmektedir."><font color="f97b00"><b><?php echo array_search((string)$countyayin, $facultylist); ?></b></font> (1-<?php echo count($facultylist)-1; ?>)<img src="images/reasonicon.gif"></img></a></p>
					<p id="puserdetailed">&nbsp;&nbsp;Üniversite yayın sıralamanız&nbsp;: <a class="tooltip" title="Bu rakam toplam yayın sayınıza göre <b>üniversite</b> sıralamasında<br>belirtilen aralıkta kaçıncı grupta olduğunuzu ifade etmektedir."><font color="f97b00"><b><?php echo array_search((string)$countyayin, $universitylist); ?></b></font> (1-<?php echo count($universitylist)-1; ?>)<img src="images/reasonicon.gif"></img></a></p>
					*/ ?>
					</p>
					
				</div>
				<div class="summaryTableSmallBottom">
				</div>
			</div>
			<div class="summaryTableSmall2">
				<div class="summaryTableSmallTop">
					Makale İstatistikleri
				</div>
				<div class="summaryTableSmallMiddle">
					<table cellspacing="0" cellpadding="0" class="summaryTableMakale">
						<tr id="summaryTableMakaleRowTop">
							<td id="summaryTableMakaleTD1">&nbsp; Dergi Sınıf</td>
							<td>SCI</td>
							<td>SCIE</td>
							<td>SSCI</td>
							<td>AHCI</td>
							<td>Alan</td>
							<td>Diğer</td>
							<td bgcolor="#ffeac9"><font color="#555555">Toplam</font></td>
						</tr>
						<tr id="summaryTableMakaleRow1">
							<td id="summaryTableMakaleTD1">&nbsp; A Grubu</td>
<?php 

						$querystata = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, COUNT(indeks_turu) as total FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_tipi = 'Makale' and sinif = 'A'");
						$querystatb = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, COUNT(indeks_turu) as total FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_tipi = 'Makale' and sinif = 'B'");
						$querystatc = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, COUNT(indeks_turu) as total FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_tipi = 'Makale' and sinif = 'C'");
						$querystatd = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, COUNT(indeks_turu) as total FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_tipi = 'Makale' and sinif = 'D'");
						$querystatdiger = $_DB->Query("SELECT IFNULL(SUM(indeks_turu = 'SCI'), 0) AS sci, IFNULL(SUM(indeks_turu = 'SCIE'),0) AS scie, IFNULL(SUM(indeks_turu = 'SSCI'),0) AS ssci, IFNULL(SUM(indeks_turu = 'AHCI'),0) AS ahci, IFNULL(SUM(indeks_turu = 'Alan'),0) AS alan, IFNULL(SUM(length(indeks_turu) < 1),0) AS diger, COUNT(indeks_turu) as total FROM fen_publications WHERE member_id = '".$_SESSION['user_id']."' and yayin_tipi = 'Makale' and length(sinif) = 0");
						
?>							
							<td><?php echo $_DB->GetResultValue($querystata, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystata, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystata, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystata, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystata, "0", "alan"); ?></td>
							<td>-</td>
							<td id="summaryTableMakaleTD2"><?php echo $_DB->GetResultValue($querystata, "0", "total"); ?></td>
						</tr>
						<tr id="summaryTableMakaleRow2">
							<td id="summaryTableMakaleTD1">&nbsp; B Grubu</td>
							<td><?php echo $_DB->GetResultValue($querystatb, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatb, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatb, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatb, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatb, "0", "alan"); ?></td>
							<td>-</td>
							<td id="summaryTableMakaleTD2b"><?php echo $_DB->GetResultValue($querystatb, "0", "total"); ?></td>
						</tr>
						<tr id="summaryTableMakaleRow1">
							<td id="summaryTableMakaleTD1">&nbsp; C Grubu</td>
							<td><?php echo $_DB->GetResultValue($querystatc, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatc, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatc, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatc, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatc, "0", "alan"); ?></td>
							<td>-</td>
							<td id="summaryTableMakaleTD2"><?php echo $_DB->GetResultValue($querystatc, "0", "total"); ?></td>
						</tr>
						<tr id="summaryTableMakaleRow2">
							<td id="summaryTableMakaleTD1">&nbsp; D Grubu</td>
							<td><?php echo $_DB->GetResultValue($querystatd, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatd, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatd, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatd, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatd, "0", "alan"); ?></td>
							<td>-</td>
							<td id="summaryTableMakaleTD2b"><?php echo $_DB->GetResultValue($querystatd, "0", "total"); ?></td>
						</tr>
						<tr id="summaryTableMakaleRow1">
							<td id="summaryTableMakaleTD1">&nbsp; Diğer</td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "sci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "scie"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "ssci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "ahci"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "alan"); ?></td>
							<td><?php echo $_DB->GetResultValue($querystatdiger, "0", "diger"); ?></td>
							<td id="summaryTableMakaleTD2"><?php echo $_DB->GetResultValue($querystatdiger, "0", "total"); ?></td>
						</tr>
					</table>
				</div>
				<div class="summaryTableSmallBottom">
				</div>
			</div>
			<div class="summaryTableSmall2">
				<div class="summaryTableSmallDepartmentTop">
					<p>Teşvik Müracaatları</p>
				</div>
				<div class="summaryTableSmall2Middle">
	
						<div id="departments"></div>
						<p id="tesvikp">Bugüne kadar toplam <font color="#0289b5"><b><?php echo $_DB->GetResultValue($querymuracaat, "0", "odendi"); ?></b></font> müracaatınız için ödeme yapılmıştır.
<?php 
	if ($_DB->GetResultValue($querymuracaat, "0", "red") != '0') {
?>	
	<font color="#dd0303"><b><?php echo $_DB->GetResultValue($querymuracaat, "0", "red"); ?></b></font> başvurunuz ise yayın teşvik kriterlerini sağlamadığı için reddedilmiştir.	
<?php 
} else { echo "Yayın teşvik kriterlerini sağlamayan başvurunuz bulunmamaktadır."; }
?>				
						</p>
					
						<table cellspacing="0" cellpadding="0" class="summaryTableTesvik">
							<tr id="summaryTableMakaleRowTop">
								<td id="summaryTableMakaleTD1b">&nbsp; Beklediği Birim</td>
								<td bgcolor="#d9edf9"><font color="#555555">Sayı</font></td>
							</tr>
							<tr id="summaryTableMakaleRow1">
								<td id="summaryTableMakaleTD1">&nbsp; Yayın Komisyonu</td>
								<td bgcolor="#fafafa"><b><?php echo $_DB->GetResultValue($querymuracaat, "0", "komisyon"); ?></b></td>
							</tr>
							<tr id="summaryTableMakaleRow2">
								<td id="summaryTableMakaleTD1">&nbsp; Rektörlük</td>
								<td bgcolor="#f0f0f0"><b><?php echo $_DB->GetResultValue($querymuracaat, "0", "rektorluk"); ?></b></td>
							</tr>
							<tr id="summaryTableMakaleRow1">
								<td id="summaryTableMakaleTD1">&nbsp; Mali İşler</td>
								<td bgcolor="#fafafa"><b><?php echo $_DB->GetResultValue($querymuracaat, "0", "mali"); ?></b></td>
							</tr>
							<tr id="summaryTableMakaleRow2">
								<td id="summaryTableMakaleTD2c">&nbsp; <b>Toplam</b></td>
								<td id="summaryTableMakaleTD2b"><b><?php echo $_DB->GetResultValue($querymuracaat, "0", "komisyon") + $_DB->GetResultValue($querymuracaat, "0", "rektorluk") + $_DB->GetResultValue($querymuracaat, "0", "mali"); ?></b></td>
							</tr>
						</table>
						
					<br>
					<p id="tesvikp">Yayınlarınızı listelemek için lütfen <a id="ablue" href="form.php?fid=2"><u>tıklayınız.</u></a>
					<br>Toplantı bildirilerinizi listelemek için lütfen <a id="ablue" href="form.php?fid=1"><u>tıklayınız.</u></a><br>
					</p><br><br><br>
				</div>
				<div class="summaryTableSmallBottom">
				</div>
			</div>
			<div id="space">&nbsp;</div>
			<div class="summaryTableSmall2">
				<div class="summaryTableSmallDepartmentTop">
					<p>Yayın İstatistikleri</p>
					<select class="selectShortDepartment" type="text" name="chart" id="chart">
						<option value="0">Bar Grafiği</option>
						<option value="1" selected>Çizgi Grafiği</option>
						<option value="2">Alan Grafiği</option>
					</select>
				</div>
				<div class="summaryTableSmall2Middle">
					<div id="chartdiv"></div>
					
					<p id="yayinp2">Toplam yayın sayısı: <font color="#0289b5"><b><?php echo $countyayin; ?></b></font></p><p id="yayinp"><img src="images/boxBlue.gif"></img> Makale &nbsp;&nbsp;<img src="images/boxGray.gif"></img> Kitap bölümü&nbsp;&nbsp; <img src="images/boxGreen.gif"></img> Kitap&nbsp;&nbsp; <img src="images/boxOrange.gif"></img> Bildiri</p>
					<br><br>
					
				</div>
				<div class="summaryTableSmallBottom">
				</div>
			</div>
			
			

		</div>	
		
		
	</div>

	
<?php 
	
}
?>